//
// Circular Linked Queue
// Created by Win10 on 2022/10/30.
//

#ifndef C_DATA_STRUCTURE_CL_QUEUE_H
#define C_DATA_STRUCTURE_CL_QUEUE_H

typedef int ElemType;

typedef struct LinkNode {
    ElemType data;
    struct LinkNode *next;
} LinkNode;

typedef struct {
    LinkNode *front, *rear;
    int size;
} ClQueue;

bool InitQueue(ClQueue &Q, int space);

bool QueueEmpty(ClQueue Q);

bool QueueFull(ClQueue Q);

bool EnQueue(ClQueue &Q, ElemType x);

bool DeQueue(ClQueue &Q, ElemType &x);

bool GetHead(ClQueue Q, ElemType &x);

int GetSize(ClQueue Q);

#endif //C_DATA_STRUCTURE_CL_QUEUE_H
